/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itschapala.dsw2.invernadero.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Raven
 */
@Entity
@Table(name = "payment")
@XmlRootElement 
@NamedQueries({
    @NamedQuery(name = "Payment.findAll", query = "SELECT p FROM Payment p"),
    @NamedQuery(name = "Payment.findByIdpayment", query = "SELECT p FROM Payment p WHERE p.idpayment = :idpayment"),
    @NamedQuery(name = "Payment.findByDaysWorked", query = "SELECT p FROM Payment p WHERE p.daysWorked = :daysWorked"),
    @NamedQuery(name = "Payment.findByHoursWorked", query = "SELECT p FROM Payment p WHERE p.hoursWorked = :hoursWorked"),
    @NamedQuery(name = "Payment.findByOverTime", query = "SELECT p FROM Payment p WHERE p.overTime = :overTime"),
    @NamedQuery(name = "Payment.findByPay", query = "SELECT p FROM Payment p WHERE p.pay = :pay")})
public class Payment implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idpayment")
    private Integer idpayment;
    @Size(max = 45)
    @Column(name = "daysWorked")
    private String daysWorked;
    @Column(name = "hoursWorked")
    private Integer hoursWorked;
    @Size(max = 45)
    @Column(name = "overTime")
    private String overTime;
    @Column(name = "pay")
    private Integer pay;
    @JoinColumn(name = "staff_idstaff", referencedColumnName = "idstaff")
    @ManyToOne
    private Staff staffIdstaff;

    public Payment() {
    }

    public Payment(Integer idpayment) {
        this.idpayment = idpayment;
    }

    public Integer getIdpayment() {
        return idpayment;
    }

    public void setIdpayment(Integer idpayment) {
        this.idpayment = idpayment;
    }

    public String getDaysWorked() {
        return daysWorked;
    }

    public void setDaysWorked(String daysWorked) {
        this.daysWorked = daysWorked;
    }

    public Integer getHoursWorked() {
        return hoursWorked;
    }

    public void setHoursWorked(Integer hoursWorked) {
        this.hoursWorked = hoursWorked;
    }

    public String getOverTime() {
        return overTime;
    }

    public void setOverTime(String overTime) {
        this.overTime = overTime;
    }

    public Integer getPay() {
        return pay;
    }

    public void setPay(Integer pay) {
        this.pay = pay;
    }

    public Staff getStaffIdstaff() {
        return staffIdstaff;
    }

    public void setStaffIdstaff(Staff staffIdstaff) {
        this.staffIdstaff = staffIdstaff;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpayment != null ? idpayment.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Payment)) {
            return false;
        }
        Payment other = (Payment) object;
        if ((this.idpayment == null && other.idpayment != null) || (this.idpayment != null && !this.idpayment.equals(other.idpayment))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mx.itschapala.dsw2.invernadero.modelo.Payment[ idpayment=" + idpayment + " ]";
    }
    
}
